import {httpGet, httpPost, httpPut} from '@frontend/vue-common'
import {getCurrentGlobalProperties} from "@frontend/vue-common/src/app";

export const listProductCustomFieldAPI = (pageNum, pageSize, sortField, sortOrder, filter) => {
    return httpGet("/v1/soms/productCustomField", {
        pageNum: pageNum,
        pageSize: pageSize,
        sortField: sortField,
        sortOrder: sortOrder,
        name: filter.name,
		explain: filter.explain,
		type: filter.type,
		requiredFlag: filter.requiredFlag,
		printFlag: filter.printFlag,
		sort: filter.sort,
		optionValue: filter.optionValue,
		
    })
}

export const addProductCustomFieldAPI = (data) => {
    return httpPut("/v1/soms/productCustomField", data)
}

export const getProductCustomFieldAPI = (data) => {
    return httpGet(`/v1/soms/productCustomField/${data.id}`, {})
}

export const editProductCustomFieldAPI = (data) => {
    return httpPost(`/v1/soms/productCustomField/${data.id}`, data)
}

export const deleteProductCustomFieldAPI = (ids) => {
    return httpPost(`/v1/soms/batchDeleteProductCustomField`, {
        ids: ids,
    })
}

